﻿@{
    Layout = "_ConfigurePlugin";
}
@using Microsoft.AspNetCore.Mvc.Razor
@model Payments.CashOnDelivery.Models.ConfigurationModel
@await Component.InvokeAsync("StoreScope")
<input id="active-menu-item" type="hidden" value="/Admin/Payment/Methods"/>
<form asp-controller="PaymentCashOnDelivery" asp-action="Configure" method="post">

    @{
        Func<int, HelperResult>
            template = @<div class="form-body">
                           <div class="form-group">
                               <div class="col-md-3 col-sm-3 text-right">
                                   <admin-label asp-for="@Model.Locales[item].DescriptionText" class="control-label"/>
                               </div>
                               <div class="col-md-9 col-sm-9">
                                   <admin-textarea asp-for="@Model.Locales[item].DescriptionText"></admin-textarea>
                                   <span asp-validation-for="@Model.Locales[item].DescriptionText"></span>
                               </div>
                           </div>
                           <input asp-for="@Model.Locales[item].LanguageId" type="hidden"/>
                       </div>;
    }

    <div class="form-horizontal">
        <localized-editor localized-template="@template" name="plugin-settings-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
            <div class="form-body">
                <div class="form-group">
                    <div class="col-md-3 col-sm-3 text-right">
                        <admin-label asp-for="DescriptionText" class="control-label"/>
                    </div>
                    <div class="col-md-9 col-sm-9">
                        <admin-textarea asp-for="DescriptionText"></admin-textarea>
                        <span asp-validation-for="DescriptionText"></span>
                    </div>
                </div>
            </div>
        </localized-editor>
        <div class="form-body">
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    <admin-label asp-for="AdditionalFee" class="control-label"/>
                </div>
                <div class="col-md-9 col-sm-9">
                    <admin-input asp-for="AdditionalFee"/>
                    <span asp-validation-for="AdditionalFee"></span>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    <admin-label asp-for="AdditionalFeePercentage" class="control-label"/>
                </div>
                <div class="col-md-9 col-sm-9">
                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                        <admin-input asp-for="AdditionalFeePercentage"/>
                        <div class="control__indicator"></div>
                    </label>
                    <span asp-validation-for="AdditionalFeePercentage"></span>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    <admin-label asp-for="ShippableProductRequired" class="control-label"/>
                </div>
                <div class="col-md-9 col-sm-9">
                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                        <admin-input asp-for="ShippableProductRequired"/>
                        <div class="control__indicator"></div>
                    </label>
                    <span asp-validation-for="ShippableProductRequired"></span>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    <admin-label asp-for="SkipPaymentInfo" class="control-label"/>
                </div>
                <div class="col-md-9 col-sm-9">
                    <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
                        <admin-input asp-for="SkipPaymentInfo"/>
                        <div class="control__indicator"></div>
                    </label>
                    <span asp-validation-for="SkipPaymentInfo"></span>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    <admin-label asp-for="DisplayOrder" class="control-label"/>
                </div>
                <div class="col-md-9 col-sm-9">
                    <admin-input asp-for="DisplayOrder"/>
                    <span asp-validation-for="DisplayOrder"></span>
                </div>
            </div>
        </div>
        <div class="form-actions">
            <div class="row">
                <div class="offset-md-3 offset-sm-3 col-md-9 col-sm-9">
                    <input type="submit" name="save" class="btn green" value="@Loc["Admin.Common.Save"]"/>
                </div>
            </div>
        </div>
    </div>
</form>